using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Billing
{
    public class MaskChecker
    {
        public static bool IsEmail(string inputEmail)
        {
            string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
                  @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
                  @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
            Regex re = new Regex(strRegex);
            if (re.IsMatch(inputEmail))
                return (true);
            else
                return (false);
        }
        public static bool IsNumber(string n)
        {
            try
            {
                Int32.Parse(n.Trim());
                return true;
            }
            catch { return false; }
        }
        public static bool IsNumber(char n)
        {
            return IsNumber(n.ToString());
        }
        public static bool IsDecimal(string n)
        {
            try
            {
                Decimal.Parse(n.Trim());
                return true;
            }
            catch { return false; }
        }
        public static bool IsDecimal(char n)
        {
            return IsDecimal(n.ToString());
        }
    }
}
